import { defineComponent } from 'vue';
import { EleModal } from 'ele-admin-pro';
import { Form, Input, FormItem } from 'ant-design-vue';
import { getFormCols } from '../config/fromConfig';

const TableFilter = defineComponent({
  components: { EleModal },
  props: {
    visible: {
      type: Boolean,
      default: () => {
        return false;
      }
    },
    data: {
      type: Object,
      default: () => {
        return null;
      }
    },
    closeTableFilter: null
  },
  setup(props) {
    return () => (
      <EleModal title={'dddd'} visible={props.visible}>
        <Form>
          {getFormCols().map((rows) => {
            if (rows.length == 1) {
              return (
                <FormItem label={rows[0].title}>
                  <Input />
                </FormItem>
              );
            } else {
              rows.map((row) => {
                return (
                  <FormItem label={row.title}>
                    <Input />
                  </FormItem>
                );
              });
            }
          })}
        </Form>
      </EleModal>
    );
  }
});
export default TableFilter;
